package com.example.recommendationservice.controller;

import com.example.recommendationservice.entity.ProductsTags;
import com.example.recommendationservice.service.RecommendationService;
import com.example.recommendationservice.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/recommendations")
public class RecommendationController {


    @Autowired
    private  RecommendationService recommendationService;

    //根据用户ID获取推荐商品
    @GetMapping("/{userId}")
    public Result<List<String>> getRecommendations(@PathVariable String userId) {

        List<String> recommendations = recommendationService.getRecommendations(userId);

        return Result.success(recommendations);
    }

}